package com.zp.business.entity.outpFees;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zp.common.core.entity.BaseEntity;
import com.zp.common.satoken.utils.LoginHelper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 门诊收费支付类型方式对象 outp_fees_payments_money
 *
 * @author zhang peng
 * @ date 2024-04-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("outp_fees_payments_money")
public class OutpFeesPaymentsMoney extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "outp_fees_payments_id")
    private String outpFeesPaymentsId;

    /**
     * 门诊收费主记录id
     */
    private String outpFeesMasterId;

    /**
     * 收费号
     */
    private String feesNo;

    /**
     * 金额类型
     */
    private String moneyType;

    /**
     * 实收金额
     */
    private BigDecimal charges;

    /**
     * 机构ID
     */
    private String orgId;

    /**
     * 标志
     */
    @TableLogic
    private String delFlag;
    /**
     * 备注信息
     */
    private String remarks;
    /**
     * 熔断后异常信息
     */
    @TableField(exist = false)
    private String exceptionCode;

    /**
     * 流水号
     */
    private String serialNo;

    public void initEntity () {
        this.delFlag = "0";
    }

    /**
     * 修改人、修改时间信息信息
     */
    public void updateInfo () {
        setUpdateBy(LoginHelper.getLoginUser().getNickName());
        setUpdateTime(new Date());
    }

}
